<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue-2.6.12开发.js"></script>
</head>

<body>
    <!-- 
        1.v-once
              1.v-once所在节点在初次动态渲染后 就视为静态内容了(不会在随着数据变化响应了)
              2.以后数据的改变不会引起v-once所在结构的更新 可以用于优化性能
     -->
    <div id="root">
        <h1 v-once>n的初始值是{{n}}</h1>
        <h1>当前的n值是{{n}}</h1>
        <button @click="n++">
            点击n++
        </button>
    </div>
    <script>
        new Vue({
            el: '#root',
            data: {
                name: '刘亦菲',
                n: 1
            }
        })
    </script>
</body>

</html>